package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.JourneyDTO;
import com.startup.yellocar.dao.JourneyDAO;

import com.startup.yellocar.service.JourneyService;

@Service
@Transactional
public class JourneyServiceImpl implements JourneyService {

	@Autowired
	protected JourneyDAO journeyDAO;

	@Transactional
	public void insert(JourneyDTO journeyDTO){
		journeyDAO.insert(journeyDTO);
	}

	@Transactional
	public void update(JourneyDTO journeyDTO){
		journeyDAO.update(journeyDTO);
	}

	@Transactional
	public JourneyDTO get(int id) {
		return journeyDAO.get(id);
	}

	@Transactional
	public List<JourneyDTO> getAll() {
		return journeyDAO.getAll();
	}

	@Transactional
	public void delete(JourneyDTO journeyDTO){
		journeyDAO.delete(journeyDTO);
	}

}
